package com.wwmz.pattern.factory.simple;

/**
 * 简单工厂
 * Created by wumz on 2020/9/15 17:22
 */
public class Test {

    public static void main(String[] args) {
//        //父类指向子类的引用，后面客户端会很臃肿
//        ICourse course = new JavaCourse();
//        course.recorded();


//        CourseFactory courseFactory = new CourseFactory();
//        courseFactory.creat("java");

//        CourseFactory courseFactory = new CourseFactory();
//        ICourse creat = courseFactory.creat("com.wwmz.pattern.factory.JavaCourse");
//        creat.recorded();


        CourseFactory courseFactory = new CourseFactory();
        ICourse creat = courseFactory.creat(JavaCourse.class);
        creat.recorded();



    }

}
